package com.itheima.fanxing;

import com.itheima.domain.Student;

import java.sql.Struct;
import java.util.ArrayList;

/*
使用jdk中已经定义好的泛型方法
 */
public class Demo03 {

    public static void main(String[] args) {
        ArrayList<Student> list = new ArrayList<>();
        list.add(new Student("张三1",18));
        list.add(new Student("张三2",18));
        list.add(new Student("张三3",18));
        list.add(new Student("张三4",18));
       /* Object[] objects = list.toArray();
        for (int i = 0; i < objects.length; i++) {
            System.out.println(objects[i]);
        }*/
    Student[] arr= new Student[list.size()];
    Student[] students = list.toArray(arr);
        for (int i = 0; i < students.length; i++) {
        String name = students[i].getName();
        System.out.println(name);
    }


    getAAA(new Student("张三",18));

    }



    public static <T>  void getAAA( T s){
       // String s ="abc";
        //Student s=new Student();
        System.out.println(s);
    }
}
